class MusicPlayer(var musicList: List[String], var currentSong: String, var playMode: String) {
  
  def addMusic(name: String): Unit = {
    musicList = musicList :+ name
    println(s"音乐 '$name' 已添加到播放列表。")
    println(s"现在列表中的歌曲为${musicList.mkString(",")}")
  }
  
  def deleteMusic(name: String): Unit = {
    if (musicList.contains(name)) {
      musicList = musicList.filterNot(_ == name)
      println(s"音乐 '$name' 已从播放列表中删除。")
      println(s"现在列表中的歌曲为${musicList.mkString(",")}")
    } else {
      println(s"音乐 '$name' 不在播放列表中。")
    }
  }
  
  def play(): Unit = {
    if (musicList.contains(currentSong)) {
      println(s"正在播放: '$currentSong'")
    } else {
      println(s"当前音乐 '$currentSong' 不在播放列表中。")
    }
  }

  def pause(): Unit = {
    println(s"音乐 '$currentSong' 已暂停。")
  }
}
object MusicPlayerApp {
  def main(args: Array[String]): Unit = {
    val player = new MusicPlayer(List("国王与乞丐", "烟火里的尘埃", "新世界","SongA"), "新世界", "随机播放")
    player.play()
    player.addMusic("忒修斯的船")
    player.deleteMusic("SongA")
    player.play()
    player.pause()
  }
}